/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo1014;

import demo1012.*;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author Administrator
 */
public class BufferedReaderDemo {

    public static void main(String args[]) {
        try {
            FileReader fr = new FileReader("e:/data4.txt");
            BufferedReader br = new BufferedReader(fr);
//            System.out.println(br.readLine());
//            System.out.println(br.readLine());
//            System.out.println(br.readLine());
            String s = null;
            // String s = br.readLine();
            int sum = 0;
            while ((s = br.readLine()) != null) {
                 sum = 0;
                String ss[] = s.split(",");
                for (String s2 : ss) {
                    sum = sum + Integer.parseInt(s2);
                }
                System.out.println(sum);
            }

        } catch (FileNotFoundException e) {
            System.out.println("file not found");


        } catch (IOException e) {
            System.out.println("io error");
        }

    }
}
